<!DOCTYPE html>
<html>
    <head>
        <meta charset="UTF-8">
        <title>员工信息表</title>
        <link rel="stylesheet" href="./css/index.css" >
    </head>
    <body>
        <div class='box'>
            <h1>员工信息列表</h1>
            <form action='' method='get' class='query'>
                快速查询:<input type='text' name='search' value='<?php echo $search;?>'></input> 
                <button>搜索</button>
            </form>
            <div class='add'><a href='./staffadd_html.php'>添加员工</a> </div>
            <table border="1" cellspacing="0" cellpadding="0" class='table'>
                  <thead>
                    <tr>
                        <th>ID</th>
                        <th>姓名</th>
                        <th>头像</th>
                        <th>所属部门</th>
                        <th>出生日期</th>
                        <th>入职时间</th>
                        <th>相关操作</th>
                    </tr>
                </thead>
                <tbody>
                    <?php foreach ($staffdata as $v){?>
                        <tr>
                            <td><?php echo $v['id'];?></td>
                            <td><?php echo $v['name'];?></td>
                            <td><img src='<?php echo $v['imgurl'];?>'></td>
                            <td><?php echo $v['department'];?></td>
                            <td><?php echo $v['birthday'];?></td>
                            <td><?php echo $v['entry'];?></td>
                            <td><a href="staffupdate.php?id=<?php echo $v['id' ]?>">编辑</a><a href="javascript:" onclick="if(confirm('确定删除吗？')) location.href='staffdel.php?id=<?php echo $v['id' ]?>'">删除</a></td>
                        </tr>
                    <?php }?>
                </tbody>
            </table>
        </div>
        <?php
        // put your code here
        ?>
    </body>
</html>
